home *** CD-ROM | disk | FTP | other *** search
- /*
- Define callback routines with callback funptr passed as a parameter.
- The compiler must be set so that type "double" is a SANE 80-bit.
- */
-
- #include "xfuns.h"
- #include "callback.h"
-
- void AddXfun(char *name,char *parms,funptr entry,funptr predef,funptr callback)
- {
- (*callback)((long)ADDXFUN,name,parms,entry,predef);
- }
-
- void AddFunDim(char *name,long lim,funptr callback)
- {
- (*callback)((long)ADDFUNDIM,name,lim);
- }
-
- void ErrMsg(char *fmt,char *str,funptr callback)
- {
- (*callback)((long)ERRMSG,fmt,str);
- }
-
- void FreeExpr(EXPR xpr,funptr callback)
- {
- (*callback)((long)FREEXPR,xpr);
- }
-
- short EvalExpr(EXPR xpr,double *num,funptr callback)
- {
- return((*callback)((long)EVALEXPR,xpr,num));
- }
-
- short GetExprMatrix(EXPR xpr,double **mat,long *rows,long *cols,funptr callback)
- {
- return((*callback)((long)GETEXPRMATRIX,xpr,mat,rows,cols));
- }
-
- short GetParmVal(long n,double *num,funptr callback)
- {
- return((*callback)((long)GETPARMVAL,(long) n,num));
- }
-
- void MakeParmExpr(long n,EXPR *xpr,funptr callback)
- {
- (*callback)((long)MAKEPARMEXPR,(long) n,xpr);
- }
-
- short ProbeExpr(EXPR xpr,double *num,short *isarray,long *count,funptr callback)
- {
- return((*callback)((long)PROBEXPR,xpr,num,isarray,count));
- }
-
- short GetParmName(long n,char **name,funptr callback)
- {
- return((*callback)((long)GETPARMNAME,(long) n,name));
- }
-
- void AddIndex(EXPR *xpr,double **iptr,funptr callback)
- {
- (*callback)((long)ADDINDEX,xpr,iptr);
- }
-
- void RemoveIndex(EXPR *xpr,funptr callback)
- {
- (*callback)((long)REMOVEINDEX,xpr);
- }
-
- short GetVarVal(char *name,double *num,funptr callback)
- {
- return((*callback)((long)GETVARVAL,name,num));
- }
-
- void MakeVarExpr(char *name,EXPR *xpr,funptr callback)
- {
- (*callback)((long)MAKEVAREXPR,name,xpr);
- }
-
- short SetVarVal(char *name,double num,funptr callback)
- {
- return((*callback)((long)SETVARVAL,name,&num)); /* callback parm must be ptr size */
- }
-
- short SetVarMatrix(char *name,double *arr,long rows,long cols,funptr callback)
- {
- return((*callback)((long)SETVARMATRIX,name,arr,rows,cols));
- }
-
- void FoldVar(char *name,long lim,funptr callback)
- {
- (*callback)((long)FOLDVAR,name,lim);
- }
-
- short Stopped(funptr callback)
- {
- return((*callback)((long)STOPPED));
- }
-
- void SpinWatch(funptr callback)
- {
- (*callback)((long)SPINWATCH);
- }
-
- void SetPlotPICT(PicHandle thePic,funptr callback )
- {
- (*callback)((long)SETPLOTPICT,thePic);
- }
-
- void SizePlotPICT(double left,double bot,double width,double ht,funptr callback)
- {
- (*callback)((long)SIZEPLOTPICT,&left,&bot,&width,&ht); /* callback parm must be ptr size */
- }
-
- void GetVarString(char *name,char **str,funptr callback )
- {
- (*callback)((long)GETVARSTRING,name,str);
- }
-
- short GetDocInfo(long *docref,FSSpec *fspec,WindowPtr *plotwindow,funptr callback)
- {
- (*callback)((long)GETDOCINFO,docref,fspec,plotwindow);
- }
-
- void GetAngleUnits(double *unit,funptr callback)
- {
- (*callback)((long)GETANGLEUNITS,unit);
- }
-
- void GetAxisRect(Rect *axisrect,funptr callback)
- {
- (*callback)((long)GETAXISRECT,axisrect);
- }
-
- void GetAxisLimits(double limits[6],funptr callback)
- {
- (*callback)((long)GETAXISLIMITS,limits);
- }
-
- void GetPlotInfo(double info[12],funptr callback)
- {
- (*callback)((long)GETPLOTINFO,info);
- }
-
- short Sprintf(char *buf,char *fmt,double num,funptr callback)
- {
- (*callback)((long)SPRINTF,buf,fmt,&num);
- }
-
- void MapData(double x,double y,short *xpixel,short *ypixel,funptr callback)
- {
- (*callback)((long)MAPDATA,&x,&y,xpixel,ypixel);
- }
-
- extern void ReturnVoid(funptr callback)
- {
- (*callback)((long)RETURNVOID);
- }
-
-